<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 702
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 706
</span><span class="hs-pragma">{-# LANGUAGE PolyKinds #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Module      :  Control.Monad.Signatures</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Copyright   :  (c) Ross Paterson 2012</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Maintainer  :  R.Paterson@city.ac.uk</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Signatures for monad operations that require specialized lifting.</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- Each signature has a uniformity property that the lifting should satisfy.</span><span>
</span><span id="line-20"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Signatures</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier">CallCC</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Catch"><span class="hs-identifier">Catch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Listen"><span class="hs-identifier">Listen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Pass"><span class="hs-identifier">Pass</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-comment">-- | Signature of the @callCC@ operation,</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- introduced in &quot;Control.Monad.Trans.Cont&quot;.</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- Any lifting function @liftCallCC@ should satisfy</span><span>
</span><span id="line-29"></span><span class="hs-comment">--</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- * @'lift' (f k) = f' ('lift' . k) =&gt; 'lift' (cf f) = liftCallCC cf f'@</span><span>
</span><span id="line-31"></span><span class="hs-comment">--</span><span>
</span><span id="line-32"></span><span class="hs-keyword">type</span><span> </span><span id="CallCC"><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-var">CallCC</span></a></span></span><span> </span><span id="local-6989586621679073115"><span class="annot"><a href="#local-6989586621679073115"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679073114"><span class="annot"><a href="#local-6989586621679073114"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679073113"><span class="annot"><a href="#local-6989586621679073113"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679073114"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073115"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073113"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073115"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073114"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073115"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073114"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-comment">-- | Signature of the @catchE@ operation,</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- introduced in &quot;Control.Monad.Trans.Except&quot;.</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- Any lifting function @liftCatch@ should satisfy</span><span>
</span><span id="line-37"></span><span class="hs-comment">--</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- * @'lift' (cf m f) = liftCatch ('lift' . cf) ('lift' f)@</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span class="hs-keyword">type</span><span> </span><span id="Catch"><span class="annot"><a href="Control.Monad.Signatures.html#Catch"><span class="hs-identifier hs-var">Catch</span></a></span></span><span> </span><span id="local-6989586621679073112"><span class="annot"><a href="#local-6989586621679073112"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span id="local-6989586621679073111"><span class="annot"><a href="#local-6989586621679073111"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679073110"><span class="annot"><a href="#local-6989586621679073110"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679073111"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073110"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679073112"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073111"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073110"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073111"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073110"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | Signature of the @listen@ operation,</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- introduced in &quot;Control.Monad.Trans.Writer&quot;.</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- Any lifting function @liftListen@ should satisfy</span><span>
</span><span id="line-45"></span><span class="hs-comment">--</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- * @'lift' . liftListen = liftListen . 'lift'@</span><span>
</span><span id="line-47"></span><span class="hs-comment">--</span><span>
</span><span id="line-48"></span><span class="hs-keyword">type</span><span> </span><span id="Listen"><span class="annot"><a href="Control.Monad.Signatures.html#Listen"><span class="hs-identifier hs-var">Listen</span></a></span></span><span> </span><span id="local-6989586621679073109"><span class="annot"><a href="#local-6989586621679073109"><span class="hs-identifier hs-type">w</span></a></span></span><span> </span><span id="local-6989586621679073108"><span class="annot"><a href="#local-6989586621679073108"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679073107"><span class="annot"><a href="#local-6989586621679073107"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679073108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073107"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679073107"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679073109"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-comment">-- | Signature of the @pass@ operation,</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- introduced in &quot;Control.Monad.Trans.Writer&quot;.</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- Any lifting function @liftPass@ should satisfy</span><span>
</span><span id="line-53"></span><span class="hs-comment">--</span><span>
</span><span id="line-54"></span><span class="hs-comment">-- * @'lift' . liftPass = liftPass . 'lift'@</span><span>
</span><span id="line-55"></span><span class="hs-comment">--</span><span>
</span><span id="line-56"></span><span class="hs-keyword">type</span><span> </span><span id="Pass"><span class="annot"><a href="Control.Monad.Signatures.html#Pass"><span class="hs-identifier hs-var">Pass</span></a></span></span><span> </span><span id="local-6989586621679073106"><span class="annot"><a href="#local-6989586621679073106"><span class="hs-identifier hs-type">w</span></a></span></span><span> </span><span id="local-6989586621679073105"><span class="annot"><a href="#local-6989586621679073105"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679073104"><span class="annot"><a href="#local-6989586621679073104"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><a href="#local-6989586621679073105"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679073104"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679073106"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073106"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679073105"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073104"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-57"></span></pre></body></html>